package com.ytktt.study.week5.task2.annotation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Component注解方式
 *
 * @author ytk
 */
public class AnnotationApplication {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application-content.xml");
        Map<String, Object> components = applicationContext.getBeansWithAnnotation(Component.class);
        System.out.println(components.get("student"));
    }
}
